package juc;

import java.util.concurrent.CountDownLatch;

public class P26 {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch=new CountDownLatch(6);
        for (int i=0;i<6;i++){
            new Thread(()-> {
                countDownLatch.countDown();
                System.out.println(Thread.currentThread().getName()+"同学出教师");

            },i+"").start();
        }
        countDownLatch.await();
        System.out.println("班长关门");
    }
}
